<template>
	<!-- Main content -->
	<section class='content'>
		<div class="box box-default">
			<div class="box-body">
				<table class="table table-hover">
					<thead>
					<tr>
						<th>公司性质</th>
						<th>对应分数</th>
						<th>管理</th>
					</tr>
					</thead>
					<tbody>
					<tr v-for="item in rulesList">
						<td>{{item['col1']}}</td>
						<td>{{item['col2']}}</td>
						<td><a @click="edit">编辑</a></td>
					</tr>
					</tbody>
				</table>
			</div>
			<div class="box-footer">
			</div>
		</div>
		<div class="layer_custom_container layer_edit_container form-horizontal" style="display:none">
			<div class="box box-primary">
				<div class="box-body">
					<div class="row form-group">
						<div class="col-xs-3 control-label">公司性质</div>
						<div class="col-xs-9"><input class="form-control" type="text"></div>
					</div>
					<div class="row form-group">
						<div class="col-xs-3 control-label">对应分数</div>
						<div class="col-xs-9"><input class="form-control" type="text"></div>
					</div>
				</div>
			</div>
		</div>
	</section>
	<!-- /.content -->
</template>

<script>
	export default{
		data(){
			return {
				layer:{
					edit:'',
				},
				rulesList:[
					{
						col1:'高等院校',
						col2:25,
					},
					{
						col1:'政府机关',
						col2:25,
					},
					{
						col1:'国有企业',
						col2:40,
					},
					{
						col1:'事业性单位',
						col2:10,
					},
					{
						col1:'外资企业',
						col2:30,
					},
					{
						col1:'台港澳资企业',
						col2:15,
					},
					{
						col1:'台资企业',
						col2:30,
					},
					{
						col1:'国内私营企业',
						col2:10,
					},
					{
						col1:'个体户',
						col2:15,
					},
				]
			}
		},
		methods:{
			edit(){
				let self=this;
				this.layer.edit=layer.open({
					type: 1,
					area: ['400px'],
					title: '编辑',
					scrollbar: false,
					id: 'edit',
					content:$('.layer_edit_container'),
					btn:['取消','保存'],
					yes:function(){
						layer.close(self.layer.edit);
					},
					btn2:function(){
						console.log(2);
						//return false;
					}
				})
			}
		},
		mounted(){
			this.$nextTick(function () {
			})
		},
		beforeDestroy(){
			//用户使用输入路由跳页的时候
			layer.close(this.layer.edit);
		}
	}
</script>
<style>
	.info-box {
		cursor: pointer;
	}

	.info-box-content {
		text-align: center;
		vertical-align: middle;
		display: inherit;
	}

	.fullCanvas {
		width: 100%;
	}
</style>
